﻿using Learn.Net8.Model;
using System.Text.Json;

namespace Learn.Net8.Repository
{
    public class UserRepository : IUserRepository
    {
        public async Task<List<User>> Query()
        {
            await Task.CompletedTask;
            // 模拟从数据库中查询数据
            var data = "[{\"Id\":18,\"Name\":\"exampleName\"}]";
            //return Newtonsoft.Json.JsonConvert.DeserializeObject<List<User>>(data) ?? new List<User>();
            return JsonSerializer.Deserialize<List<User>>(data) ?? new List<User>();
        }
    }
}
